home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / apport / package-hooks / source_linux.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  1.4 KB  |  36 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''Apport package hook for the Linux kernel.
  5.  
  6. (c) 2008 Canonical Ltd.
  7. Contributors:
  8. Matt Zimmerman <mdz@canonical.com>
  9. Martin Pitt <martin.pitt@canonical.com>
  10.  
  11. This program is free software; you can redistribute it and/or modify it
  12. under the terms of the GNU General Public License as published by the
  13. Free Software Foundation; either version 2 of the License, or (at your
  14. option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
  15. the full text of the license.
  16. '''
  17. import os
  18. import subprocess
  19. from apport.hookutils import *
  20.  
  21. def add_info(report):
  22.     attach_hardware(report)
  23.     attach_file_if_exists(report, '/etc/initramfs-tools/conf.d/resume', key = 'HibernationDevice')
  24.     version_signature = report.get('ProcVersionSignature', '')
  25.     if not version_signature.startswith('Ubuntu '):
  26.         report['UnreportableReason'] = _('The running kernel is not an Ubuntu kernel')
  27.     
  28.  
  29. if __name__ == '__main__':
  30.     report = { }
  31.     add_info(report)
  32.     for key in report:
  33.         print '%s: %s' % (key, report[key].split('\n', 1)[0])
  34.     
  35.  
  36.